<?php

class Example_Controller_404
    extends Example_Controller
{

    public function __construct(array $args = array( ))
    {
        $main = new Example_Element_Site_Main(array(
            'contents' => array(

                new OOWP_Element(array(
                    'attributes' => array(
                        'class' => array(
                            'clearfix',
                            'grid_12',
                        ),
                        'id' => 'title',
                    ),
                    'contents' => array(
                        '&laquo; 4 oh 4 &raquo;',
                    ),
                    'tag' => 'h1',
                )),

                new OOWP_Element(array(
                    'attributes' => array(
                        'class' => array(
                            'clearfix',
                            'grid_12',
                        ),
                        'id' => 'subtitle',
                    ),
                    'contents' => array(
                        'Missing something?<br/><br/>',
                    ),
                )),

                new OOWP_Element(array(
                    'attributes' => array(
                        'class' => array(
                            'center',
                        ),
                    ),
                    'contents' => array(
                        new OOWP_Atom_SearchForm( ),
     	            ),
//                    'tag' => 'p',
                )),

            ),
        ));

        $input = array_merge(array(
            'body' => new Example_Element_Site_Body(array(
                'contents' => array(
                    'main' => $main,
                ),
            )),
        ), $args);

        parent::__construct($input);
    }

    public static function matches(WP_Query $query)
    {
        if ($query->is_404) {
            return true;
        }
        return false;
    }

}
